package com.avenger.until;

import com.alibaba.druid.pool.DruidDataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * @program: BootStrapDemo
 * @description: get Druid DataSource
 * @author: guanshilong
 * @create: 2019-04-29 14:59
 **/
@Configuration
@MapperScan(basePackages = "com.avenger.mapper")
public class DataSouce {

    @ConfigurationProperties(prefix = "spring.datasource")
    @Bean
    @Primary
    public DataSource getDataSource(){
        return new DruidDataSource();
    }
}

